package com.jxc.jxc01.yk.util;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;

public class JDBCConn {
    public static PreparedStatement conn(String sql) {
        try {
            Class.forName("com.mysql.cj.jdbc.Driver");
            Connection conn = DriverManager.getConnection("jdbc:mysql:// 172.30.1.10:3306/jxc", "yk", "123456");
            PreparedStatement pstmt = conn.prepareStatement(sql);
            return pstmt;
        } catch (ClassNotFoundException e) {
            throw new RuntimeException(e);
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
    }
}
